<?xml version = "1.0"?>

<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" 
   version = "1.0">

<xsl:output method = "xml" omit-xml-declaration = "no" 
   indent = "yes" doctype-system = 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
   doctype-public = "-//W3C//DTD XHTML 1.0 Strict//EN"/>

<!-- book.xsl                                    -->
<!-- XSL document that transforms XML into XHTML -->

<!-- specify the root of the XML document -->
<!-- that references this stylesheet      -->
<xsl:template match = "employee">

   <html xmlns = "http://www.w3.org/1999/xhtml"> 
   
   <head>

      <!-- obtain book title from JSP to place in title -->
      <title><xsl:value-of select = "ename"/></title>

      <link rel = "stylesheet" href = "styles.css" 
         type = "text/css" />
   </head>

   <body>
      <p class = "bigFont"><xsl:value-of select = "ename"/></p>

       <table>
        <thead>
            <th style = "width: 200px">empno</th>
            <th style = "width: 200px">mgr</th>
            <th style = "width: 200px">deptno</th>
            <th style = "width: 200px">ename</th>
        </thead>

         <tr>
            <td>
                <xsl:value-of select="empno" />
            </td>
            <td>
<a>
<xsl:attribute name="href"><xsl:value-of select="concat('displayPersonInfo?empno=', mgr)"/></xsl:attribute>
<xsl:value-of select="//mgr/@mgrname" />
</a>
            </td>
            <td>
                <xsl:value-of select="//deptno/@deptname" />
            </td>

            <td>
                <xsl:value-of select="ename" />
            </td>
         </tr>

      </table>

      <table>
        <thead>
            <th style = "width: 200px">job</th>
            <th style = "width: 200px">sal</th>
            <th style = "width: 200px">comm</th>
            <th style = "width: 200px">hiredate</th>
        </thead>

         <tr>
            <td>
                    <xsl:value-of select="job" />
            </td>
            <td>
                    <xsl:value-of select="sal" />
            </td>
            <td>
                    <xsl:value-of select="comm" />
            </td>
            <td>
                    <xsl:value-of select="hiredate" />
            </td>
         </tr>

      </table>

        <p>
<a>
<xsl:attribute name="href"><xsl:value-of select="concat('modifyPersonInfo?empno=', empno)"/></xsl:attribute>
Edit person's details
</a>
        </p>

        <p>
            <a href = "Hierarchy.jsp">View hierarchy list</a>
            <!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
            <a href = "SimpleTable.jsp">View as simple table</a>
        </p>
    </body>

    </html> 

</xsl:template>

</xsl:stylesheet>
